import { defineConfig } from 'vite'
import electron from 'vite-plugin-electron'
import renderer from 'vite-plugin-electron-renderer'
import vue from '@vitejs/plugin-vue'
import pages from 'vite-plugin-pages'
const resolve = require('./alias.config.js');

export default defineConfig({
  plugins: [
    vue(),
    pages(
      {
        dirs: [
          {dir: 'src/views', baseRoute: '/'}
        ],
        exclude: ["**/components/*.vue"],
        extensions: ['vue']
      }
    ),
    electron([
      {
        entry: 'electron/main.js',
      },
      {
        entry: 'electron/preload.js',
        onstart(options) {
          options.reload()
        },
      },
    ]),
    renderer(),
  ],

  resolve: resolve.resolve
})
